#ifndef PLUGIN_UI_SQLITE_GLOBAL_H
#define PLUGIN_UI_SQLITE_GLOBAL_H

#include <QtCore/qglobal.h>
#include <qstring.h>

#if defined(PLUGIN_UI_SQLITE_LIBRARY)
#  define PLUGIN_UI_SQLITESHARED_EXPORT Q_DECL_EXPORT
#else
#  define PLUGIN_UI_SQLITESHARED_EXPORT Q_DECL_IMPORT
#endif


/*

 * 建表语句 表名称：tb_daily_record
   包含 时间、用户、分类、关键字、内容、备注
*/

const QString CREATE_TABLE_SQL =
    "CREATE TABLE IF NOT EXISTS tb_daily_record ("
    "id INTEGER PRIMARY KEY AUTOINCREMENT, "
    "time TEXT, "
    "user TEXT, "
    "category TEXT, "
    "keyword TEXT, "
    "content TEXT, "
    "remark TEXT"
    ")";

/*
    添加10条测试数据
*/
const QString INSERT_TEST_DATA_SQL =
    "INSERT INTO tb_daily_record (time, user, category, keyword, content, remark) VALUES "
    "('2021-01-01 00:00:00', 'deam', '学习', 'C++', '学习C++', '无'), "
    "('2021-02-01 00:00:01', 'deam1', '学习1', 'C++1', '学习C++1', '无1'), "
    "('2021-03-01 00:00:02', 'deam2', '学习2', 'C++2', '学习C++2', '无2'), "
    "('2021-04-01 00:00:03', 'deam3', '学习3', 'C++3', '学习C++3', '无3'), "
    "('2021-05-01 00:00:04', 'deam4', '学习4', 'C++4', '学习C++4', '无4'), "
    "('2021-06-01 00:00:05', 'deam5', '学习5', 'C++5', '学习C++5', '无5'), "
    "('2021-07-01 00:00:06', 'deam6', '学习6', 'C++6', '学习C++6', '无6'), "
    "('2021-08-01 00:00:07', 'deam7', '学习7', 'C++7', '学习C++7', '无7') "
;


const QString NORMAL_TABLE_NAME = "tb_daily_record";

const QString SQLITE_DB_PATH = "daily_record.db";
#endif // PLUGIN_UI_SQLITE_GLOBAL_H

